﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
namespace CorsatAdminApp.Library.TempTaskClasses
{
    public class Absence_Administration
    {
         #region private variable

        private Item _CourseTitle;
        private int _CourseLevel;
        private DataTable _Absence;
        private int _Year;


        #endregion

        #region public properties

        public Item CourseTitle
        {
            get { return _CourseTitle; }
            set { _CourseTitle = value; }
        }
     
        public int CourseLevel
        {
            get { return _CourseLevel; }
            set { _CourseLevel = value; }
        }
        public DataTable Absence
        {
            get { return _Absence; }
            set { _Absence = value; }
        }

        public int Year
        {
            get { return _Year; }
            set { _Year= value; }
        }

        #endregion

        #region Constructor

        public Absence_Administration()
        {
            CourseTitle = new Item();
            CourseLevel = 0;
            Absence = new DataTable();
            Absence.Columns.Add("AccountId", typeof(int));
            Absence.Columns.Add("ArabicName", typeof(string));
            Absence.Columns.Add(" Att_1", typeof(bool));
            Absence.Columns.Add(" Att_2", typeof(bool));
            Absence.Columns.Add(" Att_3", typeof(bool));
            Absence.Columns.Add(" Att_4", typeof(bool));
            Absence.Columns.Add(" Att_5", typeof(bool));
            Absence.Columns.Add(" Att_6", typeof(bool));
            Absence.Columns.Add(" Att_7", typeof(bool));
        }


        public Absence_Administration(int CourseTitleId,int CourseLevel,int Year)
        {

            this.Absence = DataManger.SelectAbsence(CourseTitleId,CourseLevel,Year);

        }

        #endregion


        #region private Methods


        #endregion

        #region public Methods


        public void Save()
        {
            DataManger.UpdateAbsence(this);
        }


        public List<Item> GetAllCourses()
        {
            return DataManger.SelectCourses();
        }
        #endregion



        #region override
        public override string ToString()
        {
            return CourseTitle + " " + CourseLevel;
        }
        #endregion
    }
}
